package xin.fallen.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import xin.fallen.bean.WechatEventReport;
import xin.fallen.service.WechatEventReportSer;
import xin.fallen.vo.JsonResult;

import javax.annotation.Resource;

/**
 * Author: Fallen
 * Date: 2017/3/9
 * Time: 20:48
 * Usage:
 */
@Controller
@RequestMapping("/ssp")
public class EventReportCtrl {

    @Resource
    private WechatEventReportSer wechatEventReportSerImpl;

    @ResponseBody
    @RequestMapping("/save")
    public JsonResult eventReportSave(WechatEventReport wer, String token, String code) {
        JsonResult jr = new JsonResult();
        Integer res = wechatEventReportSerImpl.eventSave(wer, token, code);
        if (res > 0) {
            jr.setRes("1");
            jr.setMsg("操作成功");
        } else {
            jr.setRes("0");
            jr.setMsg("操作失败");
        }
        return jr;
    }
}
